import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'

export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src')
    }
  },
  server: {
    allowedHosts: ['*'],
    host: '0.0.0.0',
    port: 80,
    proxy: {
      '/officialWebSite': {
        target: 'http://127.0.0.1:618',
        changeOrigin: true,
        // 如果后端接口没有 /officialWebSite 前缀，可以开启路径重写
        // rewrite: (path) => path.replace(/^\/officialWebSite/, '')
      }
    }
  }
})

